package com.youbang.settings.dao;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;
import com.youbang.settings.model.SettingEntity;
import com.youbang.settings.model.ThemeEntity;



@Mapper
@Repository
public interface SettingMapper {
	 @Update(" update t_setting\n" +
	            "    set value = #{setting.value,jdbcType=VARCHAR}\n" +
	            "    where id = #{setting.id,jdbcType=INTEGER}")
	 int updateByPrimaryKey(@Param("setting")SettingEntity setting);
	 @Select("SELECT * FROM t_theme")
	 List<ThemeEntity>  queryList();
	 @Select("SELECT * FROM t_theme where theme_name=(SELECT value FROM t_setting where id=0)")
	 ThemeEntity queryEntity(@Param("id") int id);
	 


}
